//
// Created by Semir on 2020/4/24.
//

#include <iostream>

using namespace std;

const int MAX_STEP_COUNT = 100005;
const int MODE = 100003;
int n, k;
int step[MAX_STEP_COUNT];

int main() {
    cin >> n >> k;
    step[0] = 1;
    for (int i = 1; i <= k; i++) {
        for (int j = 0; j < i; j++) {
            step[i] += step[j];
            step[i] %= MODE;
        }
    }
    for (int i = k + 1; i <= n; i++) {
        for (int j = 1; j <= k; j++) {
            step[i] += step[i - j];
            step[i] %= MODE;
        }
    }
    cout << step[n] << endl;
    return 0;
}